<template>
	<view>
		<div class="mySearch" style="display: flex;">
			<u-search :placeholder="placeholder" v-model="code" actionText="搜索" @search='search' @custom='search'
				:showAction='false'>
			</u-search>
			<div style="display: flex;">
				<div class="textDiv" @click="search"
				style="color: #0275a1;">搜索</div>
				<div class="textDiv" @click="resetSearch">重置</div>
			</div>
		</div>
	</view>
</template>

<script>
	export default {
		props: ['placeholder'],
		data() {
			return {
				code: ''
			}
		},
		methods: {
			search() {
				this.$emit('search', this.code)
			},
			resetSearch() {
				this.code = ''
				this.$emit('search', this.code)
			}
		}
	}
</script>
<style lang="scss" scoped>
	.textDiv {
		padding: 0 5px;
		font-size: 14px;
	}
</style>